﻿/*--------------------------------------------------------------------\
|       _____ _                      __  __ _    _  _____ _    _      |
|      / ____| |                    |  \/  | |  | |/ ____| |  | |     |
|     | (___ | |__   __ _ _ __ _ __ | \  / | |  | | (___ | |__| |     |
|      \___ \| '_ \ / _` | '__| '_ \| |\/| | |  | |\___ \|  __  |     |
|      ____) | | | | (_| | |  | |_) | |  | | |__| |____) | |  | |     |
|     |_____/|_| |_|\__,_|_|  | .__/|_|  |_|\____/|_____/|_|  |_|     |
|                             | |                                     |
|                             |_| Copyright(C) Shawn Sagady 2010      |
|=-------------------------------------------------------------------=|
|   Please reference the CREDITS.TXT file for license and credits.    |
\--------------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Text;

namespace SharpMUSH
{
    [Flags]
    public enum AttributeFlags
    {
        NONE            = 0x0,          // No flags set
        INTERNAL        = 0x2,          // No one can see it or set it.
        WIZARD          = 0x4,          // Wizard only can change it.
        NUKED           = 0x8,          // OBSOLETE leaving for now.
        LOCKED          = 0x10,         // Only creator of attrib may change
        NOPROG          = 0x20,         // Won't be searched for $ commands.
        MDARK           = 0x40,         // Only wizards can see it
        PRIVATE         = 0x80,         // Children don't inherit it
        NOCOPY          = 0x100,        // @clone will not copy
        VISUAL          = 0x200,        // Everyone can see this attribute
        REGEXP          = 0x400,        // Match $/^ patterns using regexps
        CASE            = 0x800,        // Match $/^ patterns case-sensitive
        SAFE            = 0x1000,       // Attribute may not be modified
        ROOT            = 0x2000,       // Root of an attribute tree
        UNDEF1          = 0x4000,       // Place Holder
        UNDEF2          = 0x8000,       // Place Holder
        STATIC          = 0x10000,      // OBSOLETE Leaving for now.
        COMMAND         = 0x20000,      // INTERNAL: Value starts with $
        LISTEN          = 0x40000,      // INTERNAL: Value starts with ^
        NODUMP          = 0x80000,      // INTERNAL: Attribute is not saved
        LISTED          = 0x100000,     // INTERNAL: used in @list attribs
        PREFIXMATCH     = 0x200000,     // Subject to prefix-matching
        VEILED          = 0x400000,     // On ex, show presences, not value
        DEBUG           = 0x800000,     // Show debug when evaluated
        NEARBY          = 0x1000000,    // Override VISUAL if remote
        PUBLIC          = 0x2000000,    // Override SAFER_UFUN
        ANON            = 0x4000000,    // INTERNAL: Not in DB
        NONNAME         = 0x8000000,    // No name in did_it
        NOSPACE         = 0x10000000,   // No space in did_it
        MHEAR           = 0x20000000,   // ^-listens can be triggered by %!
        AHEAR           = 0x40000000    // ^-listens can be triggered by anyone
    }

    public class Attribute
    {
        public string Name { get; set; }

        public AttributeFlags Flags { get; set; }

        public Object Creator { get; set; }

        public String Value { get; set; }

        public Attribute(Object creator)
        {
            Creator = creator;
        }

        public Attribute(Object creator, String value)
        {
            Creator = creator;
            Value = value;
        }

    }
}
